﻿using Abp.Dependency;
using GN.Pay.Core.Values.Entities;
using GN.Pay.TradeChannel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.Core.Runtime
{
    /// <summary>
    /// 标识生成器
    /// </summary>
    public interface IGenerateIdentifier : ISingletonDependency
    {
        /// <summary>
        /// 生成商家Id
        /// </summary>
        /// <param name="merchantName">商家名称</param>
        /// <param name="merchantType">商家类型</param>
        /// <returns></returns>
        string GenerateMerchantId(string merchantName, int merchantType);

        /// <summary>
        /// 生成应用Id
        /// </summary>
        /// <param name="merchantId">商家Id</param>
        /// <param name="appName">应用名称</param>
        /// <returns></returns>
        string GenerateAppId(string merchantId, string appName);

        /// <summary>
        /// 生成会员Id
        /// </summary>
        /// <param name="merchantId">商户Id</param>
        /// <param name="memberType">会员类型(1=个人,2=企业)</param>
        /// <param name="sourceType">来源类型(1=自行注册,2=应用注册)</param>
        /// <returns></returns>
        string GenerateMemberId(string merchantId, int memberType, int sourceType);

        /// <summary>
        /// 生成短信验证码
        /// </summary>
        /// <returns></returns>
        string GenerateSmsCheckCode();

        /// <summary>
        /// 生成应用通道希哈短验证码
        /// </summary>
        /// <param name="appId">应用</param>
        /// <param name="checkCode">短信验证码</param>
        /// <returns></returns>
        string GenerateAppHashSmsCheckCode(string appId, string checkCode);

        /// <summary>
        /// 生成应用通道希哈短验证码
        /// </summary>
        /// <param name="appId">应用</param>
        /// <param name="checkCode">短信验证码</param>
        /// <returns></returns>
        string GenerateAppHashSmsCheckCode(MerchantAppCahceInfo app, string checkCode);

        /// <summary>
        /// 生成付款申请短信验证码
        /// </summary>
        /// <param name="applyId"></param>
        /// <param name="app"></param>
        /// <param name="apply"></param>
        /// <param name="checkCode"></param>
        /// <returns></returns>
        string GeneratePayApplyHashSmsCheckCode(string applyId, MerchantAppCahceInfo app, IOrderPayApply apply, string checkCode);
    }
}
